#ifndef __PAN_LOG__
#define __PAN_LOG__

#include <syslog.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <string.h>

typedef enum {
    ERR,
    WARNING,
    INFO
}Category;


//实际打印函数
int my_log(const char *file,const char* func,int line,int Category,char *msg);

//封装宏
#define LOG(Category,msg) my_log(__FILE__,__FUNCTION__,__LINE__,Category,msg)

int init_log_system();
int log_connection(struct sockaddr *addr);
int log_operation(const char*client_ip,int port,const char *action,const char*file);
int close_log_system();
#endif
